package myUtils;

public class VecHelper
{	
	public static vec2 direction(vec2 source, vec2 dest) 
	{
		vec2 direction = new vec2(source.getX() - dest.getX(), source.getY() - dest.getY());
		return direction.normalize();
	}
	
	public static vec2 add( vec2 a, vec2 b ) 
	{
		return new vec2(a.getX() + b.getX(), a.getY() + b.getY());
	}
	
	public static float angleFromDirection(vec2 direction) 
	{
		return (float) Math.atan2(direction.getY(), direction.getX());
	}
	
	public static float dot(vec2 a, vec2 b) 
	{
		return ((a.getX() * b.getX()) + (a.getY() * b.getY()));
	}
	
	public static vec2 subtract(vec2 from, vec2 toThis) 
	{
		return (new vec2(toThis.getX() - from.getX(), toThis.getY() - from.getY()));
	}	
}